﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.ComponentModel;

using System.Windows;
/*using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;*/

namespace SDK10kWrapper
{
    public interface ICameraWPF
    {

        #region STATIC MEMBERs
#if false
        /// <summary>
        /// Play all Camera in this Form
        /// </summary>
        /// <param name="form">The Form that contain all of the CameraBox</param>
        static void PlayAll(Window form);
       
        /// <summary>
        /// Pause all Camera in this Form
        /// </summary>
        /// <param name="form">The Form that contain all of the CameraBox</param>
        static void PauseAll(Window form);

        /// <summary>
        /// Stop playing all the camera in this form
        /// </summary>
        /// <param name="form">The Form that contain all of the CameraBox</param>
        static void StopAll(Window form);

        /// <summary>
        /// Capture (Take Snapshot) of all camera 's current Frame
        /// </summary>
        /// <param name="form">The Form that contain all of the CameraBox</param>
        static void CaptureAll(Window form);

        /// <summary>
        /// Change the Capture Folder of All Camera in this Form to new Location
        /// </summary>
        /// <param name="form">The Form that contain all of the CameraBox</param>
        /// <param name="folderPath">New Folder Path you want to change</param>
        static void ChangeCaptureFolderAll(Window form, string folderPath);

        /// <summary>
        /// Change CameraMode for all Camera in this Form
        /// </summary>
        /// <param name="form">The Form that contain all of the CameraBox</param>
        /// <param name="mode"></param>
        static void ChangeModeAll(Window form, CameraMode mode);

        /// <summary>
        /// Connect all camera in this form to ACTI server
        /// </summary>
        /// <param name="form">The Form that contain all of the CameraBox</param>
        static void ConnectAll(Window form);

        /// <summary>
        /// Disconnect all camera in this form from ACTI server
        /// </summary>
        /// <param name="form">The Form that contain all of the CameraBox</param>
        static void DisconnectAll(Window form);

        /// <summary>
        /// Start recording all camera in this form
        /// </summary>
        /// <param name="form">The Form that contain all of the CameraBox</param>
        static void StartRecordAll(Window form);

        /// <summary>
        /// Change Recording Folder for all camera in this form to a new location
        /// </summary>
        /// <param name="form">The Form that contain all of the CameraBox</param>
        /// <param name="folderPath">New Folder Location to Change</param>
        static void ChangeRecordFolderAll(Window form, string folderPath);

        /// <summary>
        /// Stop Record All Camera in this form.
        /// </summary>
        /// <param name="form">The Form that contain all of the CameraBox</param>
        /// <returns>null if no file recorded otherwise a dictionary</returns>
        static Dictionary<CameraBox, FileInfo> StopRecordAll(Window form);
#endif
        #endregion

        #region INSTANCE MEMBERs
        #region Online Property
        [DefaultValue("192.168.1.1"), Category(".Camera"), Description("Camera Server IP Address")]
        string Online_IP { get; set; }

        [DefaultValue("Admin"), Category(".Camera"), Description("Camera Server Username")]
        string Online_UserName { get; set; }

        [DefaultValue("123456"), Category(".Camera"), Description("Camera Server Password")]
        string Online_Password { get; set; }

        [Category(".Camera"), Description("Check if Camera is Recording")]
        bool Online_IsRecording { get; }

        [Category(".Camera"), Description("Check if Camera is Connected to Server")]
        bool Online_IsConnected { get; set; }

        [DefaultValue("N/A"), Category(".Camera"), Description("Specify where to Save your Recording File")]
        string Online_VideoSavePath { get; set; }
        #endregion

        #region Offline Property
        [DefaultValue("N/A"), Category(".Camera"), Description("Specify where to Load your Video Playback File")]
        string Offline_VideoPlayPath { get; set; }
        #endregion

        #region Both Property
        /// <summary>
        /// Do not Set this Property in Runtime Code. Set this in Designer only for Synchronization or not
        /// </summary>
        [DefaultValue(CameraMode.Offline), Category(".Camera"), Description("Specify Camera Mode Operation")] //Browsable(false)
        CameraSyncMode CameraSyncMode { get; set; }

        [DefaultValue(CameraMode.Offline), Category(".Camera"), Description("Specify Camera Mode Operation")]
        CameraMode CameraMode { get; set; }

        [Category(".Camera"), Description("Check if Camera is Playing")]
        bool IsPlaying { get; }

        [DefaultValue("N/A"), Category(".Camera"), Description("Specify where to Save your Capture File")]
        string CapturePath { get; set; }

        #endregion
        #endregion

        #region METHODS
        #region Online Method
        /// <summary>
        /// CONNECT TO THIS CAMERA (server) & READY TO GET DATA.
        /// </summary>
        /// <returns>TRUE if connect SUCCESS otherwise FALSE</returns>
        bool Connect();

        /// <summary>
        /// DISCONNECT FROM THIS CAMERA (server) & STOP GETTING DATA.
        /// </summary>
        /// <returns>TRUE if disconnect SUCCESS otherwise FALSE</returns>
        bool Disconnect();

        /// <summary>
        /// <para>START RECORDING THIS CAMERA IN REALTIME TO A FILE.</para>
        /// <para>To change File Path set the Online_SavePath</para>
        /// </summary>
        /// <returns>TRUE if record SUCCESS otherwise FALSE</returns>
        bool StartRecord();

        /// <summary>
        /// STOP RECORDING THIS CAMERA &amp; RETURN THE FILEINFO.
        /// </summary>
        /// <returns>VALID FileInfo if record SUCCESS otherwise NULL</returns>
        FileInfo StopRecord();
        #endregion
        #region Offline Method

        #endregion
        #region Both Method

        /// <summary>
        /// <para>PLAY THIS CAMERA (depend on CameraMode you set).</para>
        /// <para>Offline will playback movie setted in Offline_FilePath, Online will play streaming realtime from server</para>
        /// </summary>
        /// <returns>TRUE if play SUCCESS otherwise FALSE</returns>
        bool Play();

        /// <summary>
        /// <para>PAUSE THIS CAMERA (depend on CameraMode you set).</para>
        /// <para>Offline will pause movie setted in Offline_FilePath, Online will pause streaming realtime from server</para>
        /// </summary>
        /// <returns>TRUE if pause SUCCESS otherwise FALSE</returns>
        bool Pause();

        /// <summary>
        /// <para>STOP THIS CAMERA (depend on CameraMode you set).</para>
        /// <para>Offline will stop movie setted in Offline_FilePath, Online will stop streaming realtime from server</para>
        /// </summary>
        /// <returns>TRUE if stop SUCCESS otherwise FALSE</returns>
        bool Stop();

        /// <summary>
        /// TURN ON SOUND DURING PLAYING CAMERA
        /// </summary>
        /// <returns>TRUE if on sound SUCCESS otherwise FALSE</returns>
        bool SoundON();

        /// <summary>
        /// TURN OFF SOUND DURING PLAYING CAMERA
        /// </summary>
        /// <returns>TRUE if off sound SUCCESS otherwise FALSE</returns>
        bool SoundOFF();

        /// <summary>
        /// Capture Entire Camera Frame into .PNG file
        /// </summary>
        /// <param name="savePath">File Path to save PNG capture into</param>
        /// <returns>null if Capture Fail otherwise a FileInfo</returns>
        FileInfo Capture(string savePath);

        /// <summary>
        /// Capture Entire Camera Frame into .PNG File set in CapturePath
        /// </summary>
        /// <returns>null if Capture Fail otherwise a FileInfo</returns>
        FileInfo Capture();
        #endregion
        #endregion
    }
}
